﻿<%@ Page Title="" Language="C#" MasterPageFile="ReconSite.Master" AutoEventWireup="true" CodeBehind="InvoiceEntry.aspx.cs" Inherits="Recon.Portal.WebUI.InvoiceEntry" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleHolder" runat="server">  
    <title>Invoice Credit Notes</title>        
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="BodyHolder" runat="server">
    <div class="formDiv" style="width:72%">
    <h2 class="formTitle">Invoice Entry</h2>
    <h1 class="formError" style="text-align:right;font-size:smaller;color:#CC2900;">Fields marked with * are mandatory</h1>
	<%--<span id="mandatoryMessage" class="formError">Fields marked with * are mandatory</span>--%>
    <table cellspacing="1" cellpadding="1" border="0" width = "100%">
   
        <%-- <script type="text/javascript">
             $(function () {
                 $("[id$=txtInvoiceDate]").datepicker({
                     showOn: 'button',
                     buttonImageOnly: true,
                     buttonImage: '../Images/cal.gif',
                     dateFormat: 'dd-mm-yy'
                 });
             });
    </script>--%>
       <%-- <script type="text/javascript" >
            function showDatePicker(a) {
                var date = document.getElementById('<%=txtInvoiceDate.ClientID%>');
                //date.value = '07-07-2013';
               // alert(date);
               // show_calendar(date, date.value);
                Datepicker();
            }

        </script>
    ---%>
<asp:Panel ID="pnlInvoice" runat ="server" Visible ="true">
<tr>
            <td  align="right" style="width:18%">
                Remitter Name : <%--<span class="required">*</span>--%>
            </td>
            
                <td align="left">
                                <asp:DropDownList ID="ddlRemitter" runat="server" DataTextField="RemitterName" DataValueField="RemitterID" />
                    </td>                 
            <td  align="right" style="width:18%">
                Invoice No.<span class="required">*</span>
            </td>
            <td >
                <asp:TextBox ID="txtInvoiceNo" runat="server" MaxLength="20" ToolTip="Enter invoice number"></asp:TextBox>
                &nbsp;<asp:RequiredFieldValidator ID="reqInvoiceNo" runat="server" 
                    ErrorMessage="Invoice No is mandatory" CssClass="formError"
                    ControlToValidate="txtInvoiceNo"  SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
            
        </tr>
        <tr>
            
             <td  align="right" style="width:18%">
                Invoice Date<span class="required">*</span>
            </td>
            <td >
                <input id="txtInvoiceDate" size="20" style="width: 125px" type="text" class="datepick"
                    runat="server" enableviewstate="false" readonly="readonly" />
            </td>
             <td  align="right" style="width:18%">
                Invoice Due Date<span class="required">*</span>
            </td>
            <td >
                <input id="txtInvoiceDueDate" size="20" style="width: 125px" type="text" class="datepick"
                    runat="server" enableviewstate="false" readonly="readonly" />
            </td>
        </tr>
       
  
         <tr>
            <td  align="right" style="width:18%; padding-bottom:12px">
                Invoice Amount<span class="required">*</span>
            </td>
            <td >
                 <asp:TextBox ID="txtIAmount" runat="server" MaxLength="15" ToolTip="Enter invoice amount"></asp:TextBox>  
                 <asp:RequiredFieldValidator ID="reqIAmount" runat="server" 
                     ErrorMessage="Amount is mandatory" CssClass="formError"
                    ControlToValidate="txtIAmount" SetFocusOnError="True" 
                        ></asp:RequiredFieldValidator>    
                &nbsp;<asp:RegularExpressionValidator ID="regIAmount" runat="server" 
                     ErrorMessage="Invalid Amount" CssClass="formError"
                    ControlToValidate="txtIAmount" SetFocusOnError="True" 
                    ValidationExpression="^[0-9]{0,}$"></asp:RegularExpressionValidator>         
            </td>  
            <td align="right" style="width:18%; padding-bottom:12px">
                PO Reference<%--<span class="required">*</span>--%></td>
            <td >
                 <asp:TextBox ID="txtIRefNoChqNo" runat="server" MaxLength="20" ToolTip="Enter PO Reference" ></asp:TextBox>   
                 <%--<asp:RequiredFieldValidator ID="reqIRefNoChqNo" runat="server" 
                     ErrorMessage="Reference No/Cheque No is mandatory" CssClass="formError"
                    ControlToValidate="txtIRefNoChqNo" SetFocusOnError="True" 
                        ></asp:RequiredFieldValidator>--%>             
            </td>                  
        </tr>      
        </tr>

      <%--  <tr>
            <td  align="right">
               Statement Status<span class="required">*</span>
            </td>
            <td colspan="3">
                 <asp:TextBox ID="txtStatementStatus" runat="server" MaxLength="1" ></asp:TextBox>   
                    &nbsp;<asp:RequiredFieldValidator ID="reqStatementStatus" runat="server" 
                     ErrorMessage="Statement Status is mandatory" CssClass="formError"
                    ControlToValidate="txtStatementStatus" SetFocusOnError="True" 
                        ></asp:RequiredFieldValidator>  
                &nbsp;<asp:RegularExpressionValidator ID="regStatementStatus" runat="server" 
                     ErrorMessage="Invalid Status" CssClass="formError"
                    ControlToValidate="txtStatementStatus" SetFocusOnError="True" 
                    ValidationExpression="^[a-zA-Z]+$"></asp:RegularExpressionValidator>   
                         
            </td>            
        </tr>--%>
        <%--<tr>
            <td  align="right">
               Is Partial?
            </td>
            <td colspan="3">
                
                <asp:CheckBox ID="chkIsPartialInvoice" runat="server" Checked="False" />
               
                
            </td>

        </tr>--%>
       
        <tr>
            <td  align="right">
                &nbsp;
            </td>
            <td colspan="3">
                <asp:Button ID="btnInvoice" runat="server" Text="Submit" onclick="btnInvoice_Click"/>&nbsp;
                <asp:Button ID="btnInvoiceCancel" runat="server" Text="Reset" onclick="btnInvoiceCancel_Click" CausesValidation="False"  />
            </td>
           <div id="dialog-modal" title=" " style="display: none">
                <p>
                    <asp:Label ID="lblJqueryTest" runat="server"/>

                </p>
            </div>
          

        </tr>
</asp:Panel>
           </table>
           
     <asp:UpdatePanel ID="upUnmatchedLists" runat="server" UpdateMode="Conditional">
        <ContentTemplate>    
                <div id="pnlMatchList" runat="server" class="pnlMatchList">    
                    <span style="azimuth: center;">
                        <div id="Div1" class="formDiv" runat ="server"  >
                            <center>
                                <asp:Label ID="lblMessage" runat="server"    CssClass="lable"/>
                            </center>
                        </div>
                    </span>
                    <div class="formDiv" style="width: 30%;">
                         <center>
                            <asp:Button ID="btnok" runat="server" Text="OK" onclick="btnok_Click" CausesValidation="False"  />
                          </center>
                    </div>
                </div>
            <div style="display: none">
                <asp:Button ID="btnManualPopup" runat="server" />
            </div>
            <ajax:ModalPopupExtender ID="btnClickPopup" runat="server" PopupControlID="pnlMatchList"
                TargetControlID="btnManualPopup" BackgroundCssClass="modalBackground" RepositionMode="RepositionOnWindowScroll" OkControlID = "btnok">
            </ajax:ModalPopupExtender>   
        </ContentTemplate>        
    </asp:UpdatePanel>
                  </div>

    <script type="text/javascript">
        function ShowPopup(msg)
        {
            $(function () {

                  $("#dialog-modal").dialog({
                    title: msg,
                    height: 150,
                    width: 350,
                    buttons:
                        {
                            //Close: function () {
                            //    $(this).dialog('close');
                            //},
                            Ok: function () {
                                $(this).dialog('close');
                            }
                        },
                    modal: true
                });


            });
        };

    </script>
    

</asp:Content>
